﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ReadBooks.Comm
{
    public abstract class CreationAuditedEntity<TPrimaryKey> : EntityBase<TPrimaryKey>
    {

        public virtual DateTime CreationTime
        {
            get;
            set;
        }


        public virtual long? CreatorUserId
        {
            get;
            set;
        }

    }
    public abstract class EntityBase: EntityBase<long>
    {

    }

    public abstract class EntityBase<T>: IEntity
    {
        public T Id { get; set; }

        public object GetId()
        {
            return Id;
        }

        public void SetId(object id)
        {
            Id = (T)id;
        }
    }
    public interface IEntity
    {
        object GetId();
        void SetId(object id);
    }
}
